<?php

namespace DesignNew\Iterator;

require("../vendor/autoload.php");

class IterClient{
    public function __construct()
    {
        $this->run();
    }

    public function run()
    {
        $stationList = new StationList();
        $stationList->addStation(new RadioStation(89));
        $stationList->addStation(new RadioStation(101));
        $stationList->addStation(new RadioStation(102));
        $stationList->addStation(new RadioStation(103.2));

        foreach($stationList as $station)
        {
            echo $station->getFrequency() . PHP_EOL;
        }

        $radioStation = new RadioStation(89);
        $stationList->removeStation($radioStation);
    }
}

$client = new IterClient();